home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
tsr21src.arc
/
MARK.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-07-20
|
3KB
|
92 lines
;MARK.ASM - mark a position in memory,
; above which TSRs will later be cleared by RELEASE.COM
; MARK can be called multiple times, each RELEASE will clear
; above the last MARK called.
;
; VERSION 1.4 2/23/86
; This version also stores the EMS page map so that RELEASE can release
; READY! and any future resident programs using expanded memory
; VERSION 1.5 2/28/86
; to keep consistent with MAPMEM and RELEASE
; VERSION 1.6 3/8/86
; store all 256 interrupts, but only 32 EMS blocks
; VERSION 1.7 4/1/86
; close the EMS handle opened to avoid using up a DOS handle
; VERSION 1.8 4/20/86
; to keep consistent with MAPMEM and RELEASE
; VERSION 1.9 5/22/86
; to keep consistent with MAPMEM and RELEASE
; VERSION 2.0 5/26/86
; to keep consistent with MAPMEM and RELEASE
; VERSION 2.1 7/18/86
; to keep consistent with RELEASE
;
; If MARK is called with something on the command line, that text will
; be stored in the program segment prefix at offset 80H, where it is
; later accessible to RELEASE for a "named" release.
;
; written for CHASM (CHeap ASseMbler)
; by Kim Kokkonen, TurboPower Software
; telephone: 408-378-3672, Compuserve 72457,2131
;
mark proc near
jmp install
idstr db 'MARK PARAMETER BLOCK FOLLOWS' ;used to find this TSR
dummy db 0 ;puts vector table on an even paragraph boundary
vector ds 400H,0 ;holds vector table (0..FF)*4 at invocation time
emscnt db 0,0 ;holds number of active pages in map that follows
emsmap ds 80H,0 ;holds EMS page map if installed
install
;store the interrupt vector table
push ds
mov cx,200H ;512 integers to store
xor ax,ax
mov ds,ax ;source address segment 0
xor si,si ;offset 0
mov di,offset(vector) ;destination offset, es=cs already
cld ;copy up
rep
movsw ;copy vectors to our table
;determine whether EMS is present
pop ds
mov dx,offset(emsnm)
mov ax,3D00H
int 21H
jb gores ;ems driver not installed
;EMS present, close the open handle first
mov bx,ax
mov ah,3EH
int 21H
;store the EMS page map
mov ah,4DH
mov di,offset(emsmap) ;es=cs already
xor bx,bx
int 67H
cmp ah,0
jnz gores ;error, ignore this step
;store the number of active handles
mov emscnt,bx ;count of active handles
;print message and TSR
gores mov dx,offset(didit)
mov ah,9
int 21H ;write success message
mov dx,offset(install) ;get end of resident portion
mov cx,4
shr dx,cl ;convert to paragraphs
inc dx ;round up
mov ax,3100H
int 21H ;terminate and stay resident
endp
;success message and version number
didit db 13,10,'MARK 2.1 - Marked current memory position',13,10,36
;file name for testing EMS presence
emsnm db 'EMMXXXX0',0